Cofnod E-bost: Systematic derivation of partition functions for ligand binding to two-dimensional lattices