Improvement on hit/miss calculation