reformed the shot detection logic