Final Commit

fix some bugs