coreregression.hs fully implemented. appears to work nicely