Matrix inversion appears to work