Fix the iterating over bonds and add some documentation