start using cog to generate dispatch code