Added functions and renamed some files