Made the code find the average amount and output data