def index(*coords)
      s = coords.last
      coords.reverse[1..-1].each do |c|
        s = perm(s) + c
      end
      perm(s)
    end
def index(*coords)
      s = coords.last
      coords.reverse[1..-1].each do |c|
        s = perm(s) + c
      end
      perm(s)
    end
A simple hashing