Mastering Functions, Variable Scope, and Modular Code Design