add a serialization function for hyper rectangles