Implemented the iterative search algorithm - code needs to be desperately cleaned up (I'll do it Saturday), but it seems to be correct.