refactored getAttempts() to getAttemptIndex()