hit/miss calculation improvements

Improvements to hit/miss calculation