new log files and code refactor
merged mdoglio's changes