Made the old code platform independent.
msvcrt replaced for Linux computers.