Imlementing Flatten; WIP
Another approach: step-like flatten; experiment