Used util method to print the array