populate matrix A

use calloc() instead of malloc()