slight re-ordering of stages