fixed the last for loop so that it doesn't skip lines