working on new path algorithm