initial work on adding restart counts, probably needs some more work still..