add do_enter function

via: http://qiita.com/yuyuchu3333/items/e9af05670c95e2cc5b4d