Begin to implement the main macro