restoring the transformation matrices