completely finished method 1-4, and their test cases