added close statements to q2