average funciton working, fully commented.
Rounds average to one decimal place now.