M Array demo code