solved q3 and q4