writing the session and tests