Removing some matrix code