code that supports sampling a large number of chains, local normalization and single precision image format