Implemented tree.
Formatted code.