elaborated session code