Added beginnings of logging.