added variables and a procedure