more efficient hash