added check on previously computed XtX, and added saving of Xtx and Xty in opt for future computation
added check on previously computed XtX, and added saving of Xtx and Xty in opt for future computation
added check on previously computed XtX