reading input matrix a now functional
sped up array allocation by adding caching and best-guess in get_a(), get_b()