add hits function (not correct)