renamed file and fixed some bugs