Tiding up code, implemented methods to calculate course average