Improved code for A*
Mark errored path red.