solution for q3