Completed the ternary code, about to test it now to make sure that it works the way it should.