Converting functions to jquery.