Fixed breadth first search algorithm, program successfully completes 1 test case