added code to calculate percentage and grade average