before closing the case evr. is working
moving targetReached to main  loop
the same as workingCode branch