adding max and min methods