implement smart_move