Reformed the shot detection logic.