Added user-defined functions with closures, environment passing, return statements, and fixed typo preventing duplicate defintion errors.