added matrix manipulation class