update aij and call Gram-schmidt twice in your code