fix the bug about if else
add some comments about the code
Merge branch 'dev'