trying to get this to write to file