Effects of confinement on thermal stability and folding kinetics in a simple Ising-like model