Added idempotence switch to BFS. still need some more patches.