Renamed variables to be more self-documenting. Implemented a basic performance optimization to prevent unnecessary jquery selections and element class modifications in a loop.