wip tidy-up debug statements