fixed createCodeTable so it returns the right values