added code from today's lecture