Work in progress
Fixed up matrix handlers