Setting up matA and matB