recalculate new desired path and refactoring