data_out function to dynamically allocate return value.