Use built-in min and max functions