Add pretty print method, and sort class