Made it write log statements to a file, fixed some imports