attempted second problem in hw