Fixed the shuffle subrountine. The matrix can now be shuffled.