improving game with usage of local variables