add toString() methods to check the correctness of the hierarchy