This is really ugly, but the first full loop can now be completed.