Add logging and comments.