Maybe the position of these lines are a bit suboptimal, as ```hit``` is set before these new lines, but is used after. So maybe the hit could be moved after these new lines?