I am not very familiar with multi-threading. Can you help me understand the need for the synchronized block here?