added jwd_setup function