Fixed all the issues with the allocation of 2d array, finilised the
first test.