minor readability fix to optimisation function