made better scipy wrapper