working out self defining scope proc
creates scope procedures