Decided to do the encoding in one method.
Added two more tests.