Fixed line by line print - added msvcrt functionality