now with min and max endstops