Add iterative version
Documentation