Theory of multivalent binding in one and two-dimensional lattices.