added median and average