Bringing in changes from example, lots of little changes.