changes the way path is returned
simplified code to get rated path