add serial version of BFS