fix codeWT and add testing