The solvent affects the rate of reaction because solvents may or may not surround a nucleophile, thus hindering or not hindering its approach to the carbon atom. Polar aprotic solvents, like tetrahydrofuran, are better solvents for this reaction than polar protic solvents because polar protic solvents will form a hydrogen bond to the nucleophile, hindering it from attacking the carbon with the leaving group.