more tidying up and testing