adding file for flattening a list recursively