coded exercise 1 for sw2