added parent support and tested the result