Changed nodes array of lists to matrix 4 faster performance