Code with 2 targets being detected but need to send it to the java file properly