functions to help test cases