another optimisation pass