one thing I just realized about flatten is that we should have used the `level` instead of a boolean flag since the beginning...