added feature to deal with parent bindings. Still need to refactor and test more rigorously.i