added extra method to calculate toroidal matrix (sort of)