Past data kinda works

Need to change code for deciding when to send it.
Fix iteration by key

* comparison of keys was incorrect
* check for iterator completion incorrect