solved 3rd problem