fix hit-calculation + add a corresponding unit test