initial macro substitution implementation //TODO complete me