bug fix, ignore same atom to be visited twice
bug fix, ignore same atom to be visited twice
updated test cases