modified crazyChild.js to use random function