change hash to to_hash

hash is a method on Objects that is supposed to return a hash code.