Added an autologging function, note the save location needs to be changed in order to work on someone else's system.