use 2D vectors instead of maps (hashes)

The biggest performance feature of vectors is that they offer O(1)
element access. This is significantly faster than using a hash, which
requires a key lookup.