Adding create function.
Create can now optionally write to the file.