added logging to file and timestamp functionality