added -log option(appends time to log.txt)