rejigged tests and some tidying up