J.W. fixed indexing in q9 and some formtatting.