Get two functions: write in file and check for spaces