Added an alternative automode loop