created question 2 classes
added code from lecture slides