solved second problem