Adding documentation for flatten