detection algorithm working