change Array2D to a templete Class