Code for SFams project