Py_ssize_t for i, j, n

return response value, so you can avoid the corner_response parameter.