Restructured instance transform matrix so it can handle 2 different rotation elements