finished using graph to solve maps problem