example now closes on ctrl-c, added some comments