Almost completed the way to print out the hierarchy
with HashMap only.