codebox snippet added
exceptions puts changed to abort
the magic 0 changed to exit in main snippet