Remove unused variables

There are a lot of unused variables in the code currently.