Implemented binary iterate function.

fixes #34