Added detector algorithm