switch to using hashes