Migrated to numpy, much simpler code.