I did it!!!!!! Recursion was the answer. HOLY SHIT