Added partially flatten a sequence
Synced with repo