bfs code for graph and also finished lab 1 of caltech course