Tried to generalize foldmpi and the lag programs