Write should go to screen, not log file.
Rearranged some use statements to ease pressure on the compiler.