Added solution and updated answer