Step 4. New matrix dimensions and values of space and 'O'