add more test cases and reverse the lines