Updated detection code to interface with Ryan's code. Did not update Main or try any testing because I'm tired and it's 1 am. Testing tomorrow.