print and flatten in doclist.ex