First working type mapper, needs lots of clean up!