Updated to the most recent version.
This version has been tested on matrices up to 4 dimensions.