the code snippet was only to illustrate the idea. reorder the code to assign values to the member variables only once outside of the loop (BTW, this is **not** nit picking, but rather a standard pattern)