has_path_sum function added