complete the second-chance method and implement using array for test data