changed memory allocation macroses, now they return values; replaced pointers on flexible arrays into goals achieved and interim structures, changed allocation of memory for stack of interim and achieved goals