add some basic functions in self consistent loop, update the log file