Implement max,min and average for data