Created bullet detection function