tried in c++, but working with json is exponantially easier in python