To allocate and initialise the array