Moved L-moment modification code into R from C