working on autorewrite

- porting some of the examples.