complete undo function

add postion_stack to record the position user input. And add stack.c to
handle position_stack.