add the Convert.hs from #180, but some style issues are left