Cheanged if to switch in scope.go

Readability improved by changing a long if-else to a switch statement.
Merge pull request #241 from tstorch/if_to_switch

Cheanged if to switch in scope.go