refactoring
detecting game done