added log file and some style nhancement