math.ceil returns a float and it must be casted for the loop to work