Reformat and add invalid move condition
Commented code, some refactoring