weird lines in case 1 and the smaller array won't write to the text file