passing min and max around