added writing to external log file
Timer implemented.