finally finished implementing triad marginal constraints and feature map; added code to check correctness.