improvements to cma optimisation