Complete 4_2 with some test cases in the main function