added beginnings of Mat wrapper