Created lambda functions for user defined types and global and local envrionmnet scopes