Added isChildOf() method.
Make implementation of swap more proper.