print array correctly