Separate-chaining version, slightly faster