code review fix, removed call-by-name, added tests