Added some logging of when events happen
Added first code to save results to file
Minor other changes