added shortest path code and made it to where it would work with class