some refactoring
removed extra squares
Merge remote-tracking branch 'origin/master' into Syzygy