full example and script