Search pseudocode

Just some pseudo code, pretty much straight from the paper.