Added ability to draw the hierarchy sorted in a grid, and sorttest.py