Turn into jquery plugin