Rewrote part of search

Couldn't test, if it breaks
comment lines 46 to 64
uncomment lines 35 to 46