adding dependency q and removing some debug code