matrix factory