added: creates A and B matrices. Computes inverse of A matrix