add flatten/3, concat/2, and atoms_concat/2