refactored app to use start/end events

added a Log file mechanism