Removed unused variables and outdated comments