corrected formula for calculating numBlocks