Added a bunch of debugging statements, and implemented searchDecl