Add functions to help determine what moves can be made
Fix a couple of small bugs