added functionality to serialize datasets