fixed BFS from Lab4_2.c