Solution for Q1 added