finished matrix generator powerMethod