Basic solution. FIXME: non-full-rank matrices.