Some scope functionality added. Scope checking still missing.