small changes: added min, max,mean