implemented transformation matrices

ahh, much cleaner.