Added support for reusing old matrices. Use with caution