added text handling and several other macros