Changed to use enumerate