made prog.vars and prog.samplers immutable