clean up compiler warnings for unused variables
Reformat code to be more readable