fixed #1 and #5
merge from branch iss1_and_5 and fix #1 and #5