solved the data structure problem. figured out how to do it