updated but not fully for phase_4 and func4