Added more documentation. Added logger.