set up basic variables and functions