canonicalize the code