'final' ish version: try scipy, fall back on slower but not terribly
slow version