setup

initialize some variables and added a function