Added solution for 3.1