tidying up for inclusion in nqp/examples