update q1 for removing variables on heap