added recursive method for calculating valid moves and some prototypes for helper functions.