add matrix interface. Still trying to make it flexible to run on CPU or GPU.