redundant code moved to function
Math.floor more accurately reflects the variable's name