Added min and max functions #152