Add writeFile function
USAGE message instead of bad error msg