clean up code, update some examples