Edited complete function and implement test case for complete function