working through bipartite graphs