Replace use of instance variables with local variables.

Also introduce additional local variables to fix selected fields remaining selecte (previously
the instance variables they used were never set)
Remove extra comma
Remove another extra comma
Merge pull request #6 from Druotic/consolidate_instance_vars

Replace use of instance variables with local variables.