added assert on q