Add basic logging.
Add logging. Rename some variables.