created and implemented first part of exercise 2