Basic attempt at writing data  - doesnt work yet - just throws an exception