solved 2nd problem