updated second question with answer