Beta -- updated from rpruim