figured out the jQuery loop problem!