assignment 1.8
using lexical scoping to reduce namespace clutter