Here is the result of the current routine for i,j in range(5):

```
>>> for i in range(5):
...  for j in range(5):
...   pprint( do(i,j))
...   print '-'*44
...
[A(1, 1)  A(1, 2)  ...  A(1, 0)]
[                              ]
[A(2, 1)  A(2, 2)  ...  A(2, 0)]
[                              ]
[  ...      ...    ...    ...  ]
[                              ]
[A(0, 1)  A(0, 2)  ...  A(0, 0)]
---------------------------------
[A(1, 1)  A(1, 2)  ...  A(1, 1)]
[                              ]
[A(2, 1)  A(2, 2)  ...  A(2, 1)]
[                              ]
[  ...      ...    ...    ...  ]
[                              ]
[A(0, 1)  A(0, 2)  ...  A(0, 1)]
---------------------------------
[A(1, 1)  A(1, 2)  ...  A(1, 2)]
[                              ]
[A(2, 1)  A(2, 2)  ...  A(2, 2)]
[                              ]
[  ...      ...    ...    ...  ]
[                              ]
[A(0, 1)  A(0, 2)  ...  A(0, 2)]
---------------------------------
[A(1, 1)  A(1, 2)  ...  A(1, 3)]
[                              ]
[A(2, 1)  A(2, 2)  ...  A(2, 3)]
[                              ]
[  ...      ...    ...    ...  ]
[                              ]
[A(0, 1)  A(0, 2)  ...  A(0, 3)]
---------------------------------
[A(1, 1)  A(1, 2)  ...  A(1, 4)]
[                              ]
[A(2, 1)  A(2, 2)  ...  A(2, 4)]
[                              ]
[  ...      ...    ...    ...  ]
[                              ]
[A(0, 1)  A(0, 2)  ...  A(0, 4)]
---------------------------------
[A(1, 1)  A(1, 2)  ...  A(1, 0)]
[                              ]
[A(2, 1)  A(2, 2)  ...  A(2, 0)]
[                              ]
[  ...      ...    ...    ...  ]
[                              ]
[A(1, 1)  A(1, 2)  ...  A(1, 0)]
---------------------------------
[A(1, 1)  A(1, 2)  ...  A(1, 1)]
[                              ]
[A(2, 1)  A(2, 2)  ...  A(2, 1)]
[                              ]
[  ...      ...    ...    ...  ]
[                              ]
[A(1, 1)  A(1, 2)  ...  A(1, 1)]
---------------------------------
[A(1, 1)  A(1, 2)  ...  A(1, 2)]
[                              ]
[A(2, 1)  A(2, 2)  ...  A(2, 2)]
[                              ]
[  ...      ...    ...    ...  ]
[                              ]
[A(1, 1)  A(1, 2)  ...  A(1, 2)]
---------------------------------
[A(1, 1)  A(1, 2)  ...  A(1, 3)]
[                              ]
[A(2, 1)  A(2, 2)  ...  A(2, 3)]
[                              ]
[  ...      ...    ...    ...  ]
[                              ]
[A(1, 1)  A(1, 2)  ...  A(1, 3)]
---------------------------------
[A(1, 1)  A(1, 2)  ...  A(1, 4)]
[                              ]
[A(2, 1)  A(2, 2)  ...  A(2, 4)]
[                              ]
[  ...      ...    ...    ...  ]
[                              ]
[A(1, 1)  A(1, 2)  ...  A(1, 4)]
---------------------------------
[A(1, 1)  A(1, 2)  ...  A(1, 0)]
[                              ]
[A(2, 1)  A(2, 2)  ...  A(2, 0)]
[                              ]
[  ...      ...    ...    ...  ]
[                              ]
[A(2, 1)  A(2, 2)  ...  A(2, 0)]
---------------------------------
[A(1, 1)  A(1, 2)  ...  A(1, 1)]
[                              ]
[A(2, 1)  A(2, 2)  ...  A(2, 1)]
[                              ]
[  ...      ...    ...    ...  ]
[                              ]
[A(2, 1)  A(2, 2)  ...  A(2, 1)]
---------------------------------
[A(1, 1)  A(1, 2)  ...  A(1, 2)]
[                              ]
[A(2, 1)  A(2, 2)  ...  A(2, 2)]
[                              ]
[  ...      ...    ...    ...  ]
[                              ]
[A(2, 1)  A(2, 2)  ...  A(2, 2)]
---------------------------------
[A(1, 1)  A(1, 2)  ...  A(1, 3)]
[                              ]
[A(2, 1)  A(2, 2)  ...  A(2, 3)]
[                              ]
[  ...      ...    ...    ...  ]
[                              ]
[A(2, 1)  A(2, 2)  ...  A(2, 3)]
---------------------------------
[A(1, 1)  A(1, 2)  ...  A(1, 4)]
[                              ]
[A(2, 1)  A(2, 2)  ...  A(2, 4)]
[                              ]
[  ...      ...    ...    ...  ]
[                              ]
[A(2, 1)  A(2, 2)  ...  A(2, 4)]
---------------------------------
[A(1, 1)  A(1, 2)  ...  A(1, 0)]
[                              ]
[A(2, 1)  A(2, 2)  ...  A(2, 0)]
[                              ]
[  ...      ...    ...    ...  ]
[                              ]
[A(3, 1)  A(3, 2)  ...  A(3, 0)]
---------------------------------
[A(1, 1)  A(1, 2)  ...  A(1, 1)]
[                              ]
[A(2, 1)  A(2, 2)  ...  A(2, 1)]
[                              ]
[  ...      ...    ...    ...  ]
[                              ]
[A(3, 1)  A(3, 2)  ...  A(3, 1)]
---------------------------------
[A(1, 1)  A(1, 2)  ...  A(1, 2)]
[                              ]
[A(2, 1)  A(2, 2)  ...  A(2, 2)]
[                              ]
[  ...      ...    ...    ...  ]
[                              ]
[A(3, 1)  A(3, 2)  ...  A(3, 2)]
---------------------------------
[A(1, 1)  A(1, 2)  ...  A(1, 3)]
[                              ]
[A(2, 1)  A(2, 2)  ...  A(2, 3)]
[                              ]
[  ...      ...    ...    ...  ]
[                              ]
[A(3, 1)  A(3, 2)  ...  A(3, 3)]
---------------------------------
[A(1, 1)  A(1, 2)  ...  A(1, 4)]
[                              ]
[A(2, 1)  A(2, 2)  ...  A(2, 4)]
[                              ]
[  ...      ...    ...    ...  ]
[                              ]
[A(3, 1)  A(3, 2)  ...  A(3, 4)]
---------------------------------
[A(1, 1)  A(1, 2)  ...  A(1, 0)]
[                              ]
[A(2, 1)  A(2, 2)  ...  A(2, 0)]
[                              ]
[  ...      ...    ...    ...  ]
[                              ]
[A(4, 1)  A(4, 2)  ...  A(4, 0)]
---------------------------------
[A(1, 1)  A(1, 2)  ...  A(1, 1)]
[                              ]
[A(2, 1)  A(2, 2)  ...  A(2, 1)]
[                              ]
[  ...      ...    ...    ...  ]
[                              ]
[A(4, 1)  A(4, 2)  ...  A(4, 1)]
---------------------------------
[A(1, 1)  A(1, 2)  ...  A(1, 2)]
[                              ]
[A(2, 1)  A(2, 2)  ...  A(2, 2)]
[                              ]
[  ...      ...    ...    ...  ]
[                              ]
[A(4, 1)  A(4, 2)  ...  A(4, 2)]
---------------------------------
[A(1, 1)  A(1, 2)  ...  A(1, 3)]
[                              ]
[A(2, 1)  A(2, 2)  ...  A(2, 3)]
[                              ]
[  ...      ...    ...    ...  ]
[                              ]
[A(4, 1)  A(4, 2)  ...  A(4, 3)]
---------------------------------
[A(1, 1)  A(1, 2)  ...  A(1, 4)]
[                              ]
[A(2, 1)  A(2, 2)  ...  A(2, 4)]
[                              ]
[  ...      ...    ...    ...  ]
[                              ]
[A(4, 1)  A(4, 2)  ...  A(4, 4)]
---------------------------------
```

Notice that the output is always 4x4 even if the matrix is only 2x2.