for the 1st problem