add the second algorithm

the algorithms work together and there is an actual pattern
lol