add .flatten()

Closes #18