added an ArrayList of Mats to write quick in memory