modified changes for collatz.js