Customise flatten_tails

Some settings are hard coded; we should fix that