Added better logging, to reveal that the problem is possibleMoves is being built badly for card 7. There are gaps in the arrays, so it's passing in undefined to move piece for the starting index sometimes.