Moved the determineFloorY function to the utils file