using hash instead of search