Added JS functionality for the game