Attempting to integrate Nathan's code into game.js