new macro system now mostly works, added final macro injection.