the code now handles all test cases from Scott Martin - WEBSVCS-215