adding close and code variables