Adding the jQuery plugin developped
adapting the code to the jQuery plugin