Fixed logger.
Added comments