add prettyprint for code in samples
modified code sample