Now serializes and unserializes matrices