swap chRoot with chCode (were really messed up)