Fixed the jQuery code to cache classes and IDs instead of calling them from DOM over and over againg