Created, what i think should work, as a brute force solution
Created small test list, again
Solves the problem but in a horribly inefficient way. Blows up the RAM. All over the place