added variables and function

added variables and function