Added hierarchy.
Next step: fixing bugs.