Created algorithm to factor matrices. Just need to parse for matrices now.