Removing unused variables

Gave a name to a struct because the compiler complained that it was anonymous.

Removed unused variables from various functions as identified by the compiler. I also manually checked to see that they were not referenced within their respective functions.

There was one line ```done:``` that I was unsure of the meaning. It looks like a switch(?) but there is no switch.