knight_travails solution thanks to Donald's code