Bfs for 2-d Array