Added check functionality and game over