trying to refactor my js into jquery..still confused?