game()function, triggerEvent(), js changes