completed find_covering_paths function