added sort for parents, excluded for properties

might want to implement a more efficient algorithm later