simplified toString method
added empty tree constraint