added functionality to pause game by pressing z key.