made -rphi work properly with sampling