added ability to buffer instead of print