Simplified BN structure to flat arrays + added samiam