More algorithms for algorithm god! (base detection, unfinished)