Adding variation to affine functions