finished ssf_Mediation function