Copy of pmtools datadvance