switch to using hash for faster retrieval