changed rot/trans/scale code a bit