implemented flatMpa