introduced a test for Q-algo's and did restructuring