Changed parseInt to Math.floor.