Flattener work in progress