Made this back into a jquery plugin