Broke up func, fixed bug

created a check func that checks if extension is already in file

fixed bug that added a newline at end of fileExtension when deleting