added code to get data in better format