reformatted pairs js and added jquery