Added logging and timestamp functionality