made some memory saving enhancements. Added optimal statistic using U
matrices