Added new code for determining moves left.
Removed unused code and tests.