Implemented chunk serialization