An algorithm that allows the construction of two way contingency tables with specified marginal totals and a specified degree of association. The algorithm can be used to find maximum likelihood estimates of the frequencies to be expected assuming a particular log linear model when such estimates cannot be found directly from simple calculations using relevant marginal totals.