Added check for unneeded matrix calculations

- Added check for unneded translations or rotations