Huge overhall, old method relegated to junk folder for use as needed for pulling
old code; new method vectorized throughout to improve performance.