Changed to config handling and buffering of output