[yan qian] add flatten.