finished last example, and some minor API fixes to the engine