Generalized to xa being of dimension na x p