moved matrix-calculation to transformation
tidy import