fun with stdio buffering