finished setup of A matrix