Started working on conversion code

Simplifying things a bit.