fixing printing out of array