added some unit tests, fixed bug when removing child