serializing and deserializing arrays