Removed unneeded random function in JS port