matrix work done