Updated comments and removed unused variables