setting up some variables, dynamically setting values in the form