Cleaned and removed unused variables