added check on previously computed Xty
added check on previously computed Xty