first version of cpp solver working, need to make python v2 improvements