Move okchars variable definition to inside its function