Added solution and comments