fixed some bugs, and added some files