Code mix up, this is latest with loop switch