fully working.  need to write file now