Path Detection cleaned up and a lot of redundant code vaporized.