Printing to memory buffer instead