made the transform matrix computation a separate static function
general restructuring operations