Sorry... but I donīt understand how to do the program with the lookup function.

Where comes the numbers [1,3,7,15,31] from and what does it do?

How to i use the lookup to point the program to the right loop that contains the right clay combination?