Fix bfs/dfs, add moveFromTo and moveFromThrough