added more sensible power functionality to matrices