Added matrix logging