Ported most functionality of the dot detector to c++