changed name of neighbour function to parent_of