added function and variables