You are much more likely to get the answer that you seek if you follow the example of my previous reply. Provide a complete program (including data) so we all can run it and duplicate your problem. Show the output that it produces and the output that you want. Explain the difference. We do not care what indenting scheme you use, but please be consistent!