Many changes.

Retry function functional.