added code for 2nd lecture