Tidying up a bit, not finished.