Organized the file into sections. Moved machine dependent code out