Fix filename
Fix some logics but there are some bugs
Fix a variable name