implemented array matrix