test function in main