qOfX added, and a bit of cleanup