Cleaned up for submission
Changed to checking power-of-2 matrices