changed from script to jQuery plugin