Wrote min and max