Converted to chainable jQuery plugin