fixed some scope assignments, added test for set
idiomatic single line function
comments on scope assignments