Changed floor() to Math.floor()