add a hash-based approach