added generic test function