Completed helper functions for find-path