program is now writing 3 lines