This is a VEEEEEERRRRRRRRRRY slow search algorithm. It sorts numbers!
Thanks to @FlamePlayzYT for pointing out that using run without screen refresh on custom blocks would speed it up.