Added functions to generate temporary matrices
Fix to keep user transform