Work on trimmed mean function
simplify the genR function
streamline genR function further