generate update
optimal item is ok now
add get_the_nearest_3 function