gave a facelift for the example script