implements subtracting yOffset from height