started the effort of cleaning up this jquery plugin