added solution to the second final exam problem