refactored some private method returns and things in order to keep a copy of the trees sorted by character for efficient encoding.
implemented encoding. also made it so it no longer loops infitely and writes the first character to a text file until your computer crashes or you stop it.
I think encoding is working as it is suppoed to. Will need to test a bit more.