data_handling function

Utilities for data handling