margins from joint distribution - first attempt, very hackish