Change matrix to store triangles divs instead - for ease of iterating.