Filled in the compareTo() and getParent() methods