tidied up examples and added small example script