adding more logging and also outputting to a file