shortened generateRandomOp to genRandomOp