added automatrix code