fixed bug in q8 should run well for more complex cases