finish the util files and writing the new detect.cpp
finish the main changes to the code and it is so ugly.....
need to do more "decoration"...