Added comments to the code.
Log entries also prints time-stamps