example code for session 8