Working implementation of the recursive trie search, needs a bit of cleaning up + testing