implemented beginnings of serialization