added matrix-based transformation functionality