modified two former posts: fix some bugs
updated new post