movedtesting p, q, g into one class