refactoring possiblemoves