search algorithm basically works, requires -std=c++11 -pthread