Update codewriter.py

Found the error where static vars are concerned make funct independent class dependent