First tabs commit / pull request.

First tabs commit / pull request.
great job here but could you make this loop more efficient be sorting parents by age before hand?