tests helper function