many changes: tests,  refactoring, restart game after finish, fix bugs in checking possible player position