use linalg from scipy