added next_second_closest_to_average