write code

fix #2