detect algorithm which doesn't properly work