Wrote the different Detector Functions