Added solution for question #4.