test and treat function and unit test updates