more advanced tidy-ing