fixed scoping problem.  all tests now pass