calculating blocks for a wall - Search