editted new function to print out array as a table