itoa wasn't working but now seems to be, with minor glitches on first line printed out