Incorrect line following output