Changed the session establishment algorithm.