Knight moves impletion with python in BFS algorithm