code and example overhaul for v1.4