several bug revised

indentation problem. It looks added lines are tab-indented. Try `pep8 xxxx.py` the code to see what are the issues.