Inserting synchronization section

Inserting synchronization section and improving the rest of the blocks.