moved imports relevant to example into the '__main__' clause

also improved docs correspondingly