added solution for q1, correct on first system test