almost finished with exercise 2