matrix now works