BUG: need to go back to matrix form