add extensive example. python3 compatibility.