You have to move this out of cycle and functions, so it isn't assigned on every loop. Also don't assign the function to `Math.` object, we don't want to modify built in stuff.