Why there are 2 `attempts` variables here? ...just trying to understand