I was going to say use a struct too. The concept behind it can be confusing and abstract at first, but it really is the best way to solve your problem. Since it's more important for you to actually LEARN how to solve your problem instead of just copy&pasting code from the forum, I'd recommend you check out the manual page on structs and see if you can figure out how to use them yourself, and then if you need to, come back and pick from MrGuest's code (nicely written by the way wink ).