Automatic checkpointing
TODO: optimizing: 1) don't try same again if fail 2) store to disk