refactor, move give_cmd into give.c