Added Event log

Added event log + corrected bugs in log + Code clean up