Replaced Math.round() with Math.floor()