Added a method 'check_path_sum'