did most of the complext logic to save the goalfirstmanagement. G3 is remaining. Do the work starting from here