cleaned up code and consolodated jquery