added matricies as constants that you only need to compute once