added entry on scope chaining and function factories