After about 20 minutes of helplessly searching for some elbaorate algorythm I finally just stepped back and really read the instructions carefully. It's really that simple! but boy am I glad I figured it out

I can see how this thing could keep people up at night.