array/hash rewrite