Updated initializeBlocks method