changed floor to ceil on line 17