cleaned up converter, add relevant tests.