add list flattening code