improved logging.
added an if word to the refsq example.