add createCodeTable function