changed vif to numpy array and changed method for extracting restmat