added algorithms from Smirnov, small fixes to search directory