mostly finished. Now to write the actual data part