so,so working version of the code with flunky message synchronization