matrix tested a little. Now starting rewrite of hypercube using matrix lib