Now works without need of matrix to hold data