added additional tidying up