declared given variables

Declared all given variables. Also checked to see if all were captured
and stored correctly.