Slight modification for SFA main program