started matrix implementation. added an example stack module for reference