Retries reduced to 2. Unused code deleted.