more setup, assigning variables, error checking