#14 initial code for session. totally incomplete and untested