Fixing based on comments

this loop could be more effectient if parents were sorted. can you figure out a way to sort parents and break this loop  when the oldest parent is found?