Initial commit of Kazunori Fujiwara's code