removed dependency on q