Using mazeDistance to achieve best results for Q7