Fixed bugs and added simpleExample.