updating calculation and sorting of report