added binary search and dfs