Implemented get_root_goal/2, to encapsulate getter of the original goal