def smoothen(df):
    """
    Helper funciton to smooth out vacuum energy fluctuations (DFT problem).
    :param df: A DataFrame with distance and energy values.
    :return: DataFrame with smooth data.
    """
    df_new = df.copy(deep=True)
    df_new = df_new.sort_values(by='distance').reset_index(drop=True)
    for idx, entry in enumerate(df.energy):
        if idx == 0:
            previos_entry = entry
        else:
            dE = entry - previos_entry
            if dE < 0:
                df_new = df_new.drop([idx], axis=0)
            previos_entry = entry
    df_new = df_new.reset_index(drop=True)
    return df_new
