Tidied up macros. Sent to Simon and Sumeet.