The code is very brittle, no error checking is performed at all so if anything goes wrong the program will misbehave. Output is still incomplete.