Sensex gains 320 points, Nifty 50 tops 23,700; IT stocks lead rally