modify `toBlockMatrix` method