Format type correctly for new regex

Fixes cc4374a
Also adds some code comments
See #15