Added some logging features to read the array for testing purposes.