Added files and fixed some bugs