changed to hashes rather than arrays