try a matrix approach