bug fixes and improvments, now adding in shortest and next shortest routes