finished naive matrix