Updated the BFS to so that data structure is a queue. Updated the use of the wasVisited array.