small improvements, added WritePTQobs()