added min max and avg to script