Set up getMovesLegality function