added digraph class, bin_search function