completed the main detection app