removed unused variables and code that was commented out