Perhaps it's just my personal preference, but I find writing `A.toarray()` more clear than `A.A`, especially when the matrix itself is called `A`.  Would you mind changing those?