Added code mode function.