added unbuffered stdout option