Added the nextMove method and test method returnDir