Blocks problem solution