Sampling corrected. Major bug in LHS discovered and seems to be working. Bug: Between xlow and xup, same values were returned. between each segment. Now the code is also much shorter with a nicer loop construct than before.