implemented better points hashing function