get more test cases to work by adding fflush(stdout)