Removed unused variables and such