start abstracting matrix functionality