final optimisation, and typo fix