Added hit function, cant figure out how to avoid loop