Need to understand the script pls help

Can u please explain what it is doing

#!/bin/sh
fullyear=`/home/local/bin/datemmdd 1`"."`date +%Y`
uehist=/u05/home/celldba/utility/ue/prod/history
echo $fullyear
cd $uehist
ls -ltr pwroutages.master.$fullyear* | awk '{print $9}' > /u01/home/celldba/tmp/pwroutages_master_all_tmp
while read x;
do
cat $x >> $uehist/pwroutages.master_all.$fullyear;
rm -f $x
done < /u01/home/celldba/tmp/pwroutages_master_all_tmp
rm /u01/home/celldba/tmp/pwroutages_master_all_tmp

The last 8 lines could be replaced with a shorter

ls -rt ${uehist}/pwroutages.master.${fullyear}* | while read x
do
cat $x >>${uehist}/pwroutages.master_all.${fullyear} && rm -f $x
done

Mainly what it does is:

It takes all the files matching ${uehist}/pwroutages.master.${fullyear}* absolute names from the older to the newer (-rt = -reverse time),

and concatenate the content of each and every file into the file ${uehist}/pwroutages.master_all.${fullyear}

After every successfull concatenation, it deletes the corresponding ${uehist}/pwroutages.master.${fullyear}* file

Thank you very much sir, appreciate your help