finished part 5a)