change logic to test if yMin or yMax has been given