replaced **locals() with explicit dict in examples