Modified if statements

Made it so that if file was empty, to display and write to file.