Add lecture7 code