beam search and stroke feature. split function to several files under subfolder.