moved cog code back