Added more code to pathFinder.js need to rewrite it and test it.