add detector and faster code