There are a couple of replies to this node that say "use a hash". Well, in Perl, there's a fancy data structure that acts just like a hash, but takes integer keys. It's faster than a normal hash, and takes less memory, too. "What magick is this?" you may ask. It's an array! I'm poking a bit of fun, but I think that hashes are a bit of overkill for something like this.