added in hit detector and unit tests