obtaining parent_id was expensive so use this optimization instead
Merge pull request #19 from lowang/master

obtaining parent_id was expensive