added more to the tutorial. tested and fixed example code