Converted keys from tiles to arrays.

Also cleaned up.