add printMatrix kernel and indexing function
add printMatrix module and change some matrix/buffer handling