establish proper control flow for building graph
implement breadth-first search
Modularize code for constructing graph