Created Queue class for BFS method