code for session 4