added new matrix and changed quite a bit around