proper flatten