added getParents function