change data format and return this for the ouptut function