Changed all matrix code to use column vectors.