made the algorith look for children(better this time)
Merge pull request #5 from r3bhatta/master

changed algorithm to make it look into children a little better