flatten the list