pub fn smooth_elements<T>(elements: Vec<T>) -> Vec<T>where
    T: Bounded + Copy,