print out sorted array