fixed some of ethan's bugs, added jquery support