added vector allocation and test case loop